package com.hlk.controller.article;

import com.hlk.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * @author hlk
 * @version 1.0
 * @date 2020-12-30 15:03
 */
@Api(value = "门户端文章业务的controller", tags = {"门户端文章业务的controller"})
@RequestMapping("portal/article")
public interface ArticlePortalControllerApi {

    @GetMapping("list")
    @ApiOperation(value = "首页查询文章列表")
    Result list(@RequestParam String keyword, @RequestParam Integer category,
                @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                @RequestParam Integer page,
                @ApiParam(name = "pageSize", value = "分页的每一页显示的条数", required = false)
                @RequestParam Integer pageSize);

    @PostMapping("readArticle")
    @ApiOperation(value = "阅读文章，文章阅读量累加")
    Result readArticle(@RequestParam String articleId, HttpServletRequest request);

    @GetMapping("hotList")
    @ApiOperation(value = "首页查询热闻列表")
    Result hotList();

    @GetMapping("queryArticleListOfWriter")
    @ApiOperation(value = "查询作家发布的所有文章列表")
    Result queryArticleListOfWriter(@RequestParam String writerId,
                                    @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                                    @RequestParam Integer page,
                                    @ApiParam(name = "pageSize", value = "分页的每一页显示的条数", required = false)
                                    @RequestParam Integer pageSize);

    @GetMapping("queryGoodArticleListOfWriter")
    @ApiOperation(value = "作家页面查询近期佳文")
    Result queryGoodArticleListOfWriter(@RequestParam String writerId);

    @GetMapping("detail")
    @ApiOperation(value = "文章详情查询")
    Result detail(@RequestParam String articleId);

    @GetMapping("readCounts")
    @ApiOperation(value = "获得文章阅读数")
    Integer readCounts(@RequestParam String articleId);
}
